<?php

namespace app\index\validate\lawyer;

use ShidianUtil\Thinkphp\Validate\BaseValidate;

/**
 * Class LegalDraft
 * @package app\index\validate\lawyer
 * @link https://www.kancloud.cn/manual/thinkphp6_0/1037623
 * @see \app\index\controller\lawyer\LegalDraft
 */
class LegalDraft extends BaseValidate
{

    /**
     * 定义验证规则
     * 格式：'字段名' =>  ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'id' => 'isId',
        'memberId' => 'integer|max:11',
        'subType' => 'integer|egt:0|max:3',
        'checkStatus' => 'integer|egt:0|max:1',
        'checkCause' => 'scalar|max:255',
        'realname' => 'scalar|max:30',
        'provinceId' => 'integer|egt:0|max:11',
        'cityId' => 'integer|egt:0|max:11',
        'practiceNumber' => 'scalar|max:60',
        'practicingLawFirm' => 'scalar|max:200',
        'certificatePic' => 'scalar|max:200',
        'practiceTime' => 'likeId',
        'headImgUrl' => 'scalar|max:255',
        'cropImgUrl' => 'scalar|max:255',
        'introduce' => 'scalar|max:600',
        'lawFirmAdd' => 'scalar|max:200',
        'chargingStandard' => 'scalar|max:200',
        'idcardPic' => 'scalar|max:200',
        'idcard' => 'scalar|max:64',
        'legalCompany' => 'scalar|max:200',
        'pf' => 'scalar|max:32',
        'chain' => 'scalar|max:32',
        'promotionGroupId' => 'integer|egt:0|max:10',
        'updated' => 'integer|egt:0|max:11',
        'created' => 'integer|egt:0|max:11',
        'page' => 'integer|egt:0|max:11',
        'page_size' => 'integer|egt:0|max:11',
    ];

    protected $field = [
        'id' => 'id',
        'realname' => '姓名',
        'cityId' => '城市',
        'headImgUrl' => '头像',
        'idcardPic' => '身份证照片',
        'idcard2Pic' => '身份证照片',
        'idcard' => '身份证号',
        'legalCompany' => '法务公司',
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名' =>  '错误信息'
     *
     * @var array
     */
    protected $message = [
        'id.require' => '缺少:attribute',
        'id.isId' => '请设置正确的:attribute',
        'memberId.require' => '请输入:attribute',
        'memberId.integer' => ':attribute应该是整数',
        'memberId.max' => ':attribute长度不能超过:rule位',
        'subType.require' => '请输入:attribute',
        'subType.integer' => ':attribute应该是整数',
        'subType.egt' => ':attribute应该大于等于:rule',
        'subType.max' => ':attribute长度不能超过:rule位',
        'checkStatus.require' => '请输入:attribute',
        'checkStatus.integer' => ':attribute应该是整数',
        'checkStatus.egt' => ':attribute应该大于等于:rule',
        'checkStatus.max' => ':attribute长度不能超过:rule位',
        'checkCause.require' => '请输入:attribute',
        'checkCause.scalar' => ':attribute应该是字符串',
        'checkCause.max' => ':attribute长度不能超过:rule位',
        'realname.require' => '请输入:attribute',
        'realname.scalar' => ':attribute应该是字符串',
        'realname.max' => ':attribute长度不能超过:rule位',
        'provinceId.require' => '请输入:attribute',
        'provinceId.integer' => ':attribute应该是整数',
        'provinceId.egt' => ':attribute应该大于等于:rule',
        'provinceId.max' => ':attribute长度不能超过:rule位',
        'cityId.require' => '请输入:attribute',
        'cityId.integer' => ':attribute应该是整数',
        'cityId.egt' => ':attribute应该大于等于:rule',
        'cityId.max' => ':attribute长度不能超过:rule位',
        'practiceNumber.require' => '请输入:attribute',
        'practiceNumber.scalar' => ':attribute应该是字符串',
        'practiceNumber.max' => ':attribute长度不能超过:rule位',
        'practicingLawFirm.require' => '请输入:attribute',
        'practicingLawFirm.scalar' => ':attribute应该是字符串',
        'practicingLawFirm.max' => ':attribute长度不能超过:rule位',
        'certificatePic.require' => '请输入:attribute',
        'certificatePic.scalar' => ':attribute应该是字符串',
        'certificatePic.max' => ':attribute长度不能超过:rule位',
        'practiceTime.require' => '请选择:attribute',
        'practiceTime.isId' => '请选择正确的:attribute',
        'headImgUrl.require' => '请输入:attribute',
        'headImgUrl.scalar' => ':attribute应该是字符串',
        'headImgUrl.max' => ':attribute长度不能超过:rule位',
        'cropImgUrl.require' => '请输入:attribute',
        'cropImgUrl.scalar' => ':attribute应该是字符串',
        'cropImgUrl.max' => ':attribute长度不能超过:rule位',
        'introduce.require' => '请输入:attribute',
        'introduce.scalar' => ':attribute应该是字符串',
        'introduce.max' => ':attribute长度不能超过:rule位',
        'lawFirmAdd.require' => '请输入:attribute',
        'lawFirmAdd.scalar' => ':attribute应该是字符串',
        'lawFirmAdd.max' => ':attribute长度不能超过:rule位',
        'chargingStandard.require' => '请输入:attribute',
        'chargingStandard.scalar' => ':attribute应该是字符串',
        'chargingStandard.max' => ':attribute长度不能超过:rule位',
        'idcardPic.require' => '请输入:attribute',
        'idcardPic.scalar' => ':attribute应该是字符串',
        'idcardPic.max' => ':attribute长度不能超过:rule位',
        'idcard2Pic.require' => '请输入:attribute',
        'idcard2Pic.scalar' => ':attribute应该是字符串',
        'idcard2Pic.max' => ':attribute长度不能超过:rule位',
        'idcard.require' => '请输入:attribute',
        'idcard.scalar' => ':attribute应该是字符串',
        'idcard.max' => ':attribute长度不能超过:rule位',
        'legalCompany.require' => '请输入:attribute',
        'legalCompany.scalar' => ':attribute应该是字符串',
        'legalCompany.max' => ':attribute长度不能超过:rule位',
        'pf.require' => '请输入:attribute',
        'pf.scalar' => ':attribute应该是字符串',
        'pf.max' => ':attribute长度不能超过:rule位',
        'chain.require' => '请输入:attribute',
        'chain.scalar' => ':attribute应该是字符串',
        'chain.max' => ':attribute长度不能超过:rule位',
        'promotionGroupId.require' => '请输入:attribute',
        'promotionGroupId.integer' => ':attribute应该是整数',
        'promotionGroupId.egt' => ':attribute应该大于等于:rule',
        'promotionGroupId.max' => ':attribute长度不能超过:rule位',
        'updated.require' => '请输入:attribute',
        'updated.integer' => ':attribute应该是整数',
        'updated.egt' => ':attribute应该大于等于:rule',
        'updated.max' => ':attribute长度不能超过:rule位',
        'created.require' => '请输入:attribute',
        'created.integer' => ':attribute应该是整数',
        'created.egt' => ':attribute应该大于等于:rule',
        'created.max' => ':attribute长度不能超过:rule位',
        'page.require' => '请输入:attribute',
        'page.integer' => ':attribute应该是整数',
        'page.egt' => ':attribute应该大于等于:rule',
        'page.max' => ':attribute长度不能超过:rule位',
        'page_size.require' => '请输入:attribute',
        'page_size.integer' => ':attribute应该是整数',
        'page_size.egt' => ':attribute应该大于等于:rule',
        'page_size.max' => ':attribute长度不能超过:rule位',
    ];

    protected $scene = [
        'delete' => ['id' => 'require'],
        'index' => ['page', 'page_size'],
        'read' => ['id' => 'require'],
        'save' => [
            'realname' => 'require',
            'cityId' => 'require',
            'idcardPic' => 'require',
            'idcard2Pic' => 'require',
            'idcard' => 'require',
            'legalCompany' => 'require',
        ],
    ];

}
